
#ifndef _ITEMS_LIST_H_
#define _ITEMS_LIST_H_

#include "../common/error.h"

#ifndef ItemsListItemType
	#define ItemsListItemType int
	#define ItemsListItemScanFormat "%i"
#endif

typedef struct _ItemsListItem
{
	ItemsListItemType value;
	struct _ItemsListItem* next;
} ItemsListItem;

typedef struct _ItemsList
{
	int count;
	ItemsListItem* head;
	ItemsListItem* tail;
} ItemsList;

ItemsListItem* itemslist__new_item(ItemsListItemType value);
void itemslist__init_item(ItemsListItem* item, ItemsListItemType value);
ItemsList itemslist__read_list_from_file(const char* filename);
ItemsList itemslist__read_list_from_filestream(FILE* file);
ItemsListItemType* itemslist__to_array(ItemsList vector);
void itemslist__delete_vector(ItemsList vector);
void itemslist__add_item_to_list(ItemsListItemType item, ItemsList* list);
void itemslist__init(ItemsList* list);


#endif /*  _ITEMS_LIST_H_ */

